﻿/*
 * 版权所有 2024 Rapid Software LLC
 * 
 * 根据 Apache 许可证 2.0 版（“许可证”）获得许可;
 * 除非符合许可，否则您不得使用此文件.
 * 您可以在以下位置获取许可证的副本
 * 
 *     http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 * 
 * 
 * Product  : Rapid SCADA
 * Module   : Communicator Worker
 * Summary  : The Communicator service for Windows and Linux
 * 
 * Author   : Mikhail Shiryaev
 * Created  : 2021
 * Modified : 2024
 */

namespace Scada.Comm.Wkr
{
    /// <summary>
    /// The Communicator service for Windows and Linux.
    /// 适用于 Windows 和 Linux 的 Communicator 服务。
    /// <para>Служба Коммуникатора для Windows и Linux.</para>
    /// </summary>
    public class Program
    {
        public static void Main(string[] args)
        {
            var builder = Host.CreateApplicationBuilder(args);
            builder.Services
                .AddWindowsService()
                .AddSystemd()
                .AddHostedService<Worker>();

            var host = builder.Build();
            host.Run();
        }
    }
}
